package com.youhong.teethcare.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.youhong.teethcare.R;

/**
 * Created by Administrator on 2018/5/14 0014.
 */

public class DeviceNotFoundDialog extends Dialog implements View.OnClickListener {

    Runnable runnable_close;

    public DeviceNotFoundDialog(@NonNull Context context, Runnable run_close) {
        this(context, R.style.dialog_device_not_found);
        runnable_close = run_close;

    }

    Button iv_close;

    public DeviceNotFoundDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
        setContentView(R.layout.dialog_device_not_found);
        iv_close = findViewById(R.id.bt_DeviceNotFind);
        iv_close.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (v == iv_close) {

            if (runnable_close != null) {
                runnable_close.run();
            }

            this.hide();

        }
    }
}
